package com.xj.edu.hotel.service.serviceImpl;

import com.xj.edu.hotel.domain.User;
import com.xj.edu.hotel.mapper.UserMapper;
import com.xj.edu.hotel.service.LoginService;
import com.xj.edu.hotel.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class LoginServiceImpl implements LoginService{
    @Autowired
   private UserMapper userMapper;


    @Override
    public User findByName(User user) {
        return userMapper.selectByName(user.getUserName());
    }

    @Override
    public int insert(User user) {
        return 0;
    }

    @Override
    public User findByEmail(String email) {
        return userMapper.findByEmail(email);
    }

    @Override
    public int updatePassword(String userEmail, String userPassword) {
        return userMapper.updatePassword(userEmail,userPassword);
    }


}
